// 存储local
export function setTokenFn(value) {
  localStorage.setItem('X-Token', value)
}
export function setLocalKeyFn(key, value) {
  localStorage.setItem(key, JSON.stringify(value))
}

// 获取local
export function getTokenFn() {
  let url = new URL(window.location.href)
  let searchParams = new URLSearchParams(url.search)
  const tempToken2 = searchParams.get('token')
  if (tempToken2) {
    return tempToken2
  } else {
    return localStorage.getItem('X-Token')
  }
}

// 删除local
export function removeTokenFn() {
  localStorage.removeItem('X-Token')
}

// // 存储session
// export  function setSessionFn(value) {
//   sessionStorage.setItem('X-Token', value)
// }

// // 获取session
// export  function getSessionFn() {
//   return sessionStorage.getItem('X-Token')
// }

// // 删除session
// export  function removeSessionFn() {
//   sessionStorage.removeItem('X-Token')
// }
